package com.urick.spi.dubbo;

import com.urick.spi.dubbo.common.URL;
import com.urick.spi.dubbo.ext.IActiveExt;
import org.junit.Test;

import java.util.List;

/**
 * Design Theories: 自动激活实现测试用例
 * <a href=""></a>
 *
 * @author uRick 2021/12/13 11:17
 * Email: rickwork@163.com
 * Wechat: yy3076815642
 * QQ: 3076815642
 * @since 1.0
 */
public class ActiveTester {
    @Test
    public void activeTester() {
        ExtensionLoader<IActiveExt> extensionLoader = ExtensionLoader.getExtensionLoader(IActiveExt.class);
        URL url = URL.valueOf("nacos://localhost?" + IActiveExt.EXT_KEY + 1);
        List<IActiveExt> activateExtension = extensionLoader.getActivateExtension(url, "", IActiveExt.EXT_GROUP_KEY);
       activateExtension.forEach(v->System.out.println(v.exe(url)));
    }
}
